/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.diplomka.datalayer.dao;

import cz.muni.fi.diplomka.datalayer.entity.MessageEntity;
import java.util.List;

/**
 * Interface for manipulation with Message Entity
 *
 * @author Jakub Kutil
 */
public interface MessageDao {

    /**
     * Adds Message to DB
     *
     * @param messageEntity Message to add
     */
    public void addMessage(MessageEntity messageEntity);

    /**
     * Edits Message in DB
     *
     * @param messageEntity Message to edit
     */
    public void editMessage(MessageEntity messageEntity);

    /**
     * Deletes Message from DB
     *
     * @param id ID of Message to delete
     */
    public void deleteMessage(Long id);

    /**
     * Gets Message with specified ID
     *
     * @param id ID of Message to search
     *
     * @return found Message or empty one if not found
     */
    public MessageEntity findMessage(Long id);

    /**
     * Gets all recieved Messages of Player
     *
     * @param playerId ID of Player
     *
     * @return List of all recieved Messages of Player
     */
    public List<MessageEntity> getAllReceivedMessagesOfPlayer(Long playerId);

    /**
     * Gets all sent Messages of Player
     *
     * @param playerId ID of Player
     *
     * @return List of all sent Messages of Player
     */
    public List<MessageEntity> getAllSentMessagesOfPlayer(Long playerId);

    /**
     * Gets count of unread Messages of Player
     *
     * @param playerId ID of Player
     *
     * @return count of unread Messages of Player
     */
    public int getCountOfUnreadReceivedMessagesOfPlayer(Long playerId);
}
